package com.bestcem.xm.user.mq.sender;

import com.bestcem.xm.common.core.domain.web.ServiceResult;
import com.bestcem.xm.user.mq.info.group.GroupNameInfo;
import com.bestcem.xm.user.mq.info.group.StoreInfo;
import com.bestcem.xm.user.mq.message.group.ChangeGroupMessage;
import com.bestcem.xm.user.mq.message.group.CreateGroupMessage;
import com.bestcem.xm.user.mq.message.group.OpenGroupUpdateFinishMessage;
import com.bestcem.xm.user.service.UserGroupService;
import com.bestcem.xm.user.service.dto.group.UserGroupDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;

/**
 * 用户组织或者层级发消息服务
 *
 * @author qiongyu.cui <qiongyu.cui@idiaoyan.com>
 * @version v1.0
 * @date 2022/2/11 11:38
 */
@Slf4j
//@Component
@Deprecated
public class UserGroupMessageSender {
    @Resource
    private UserGroupService userGroupService;

    /**
     * 新增组织发送消息
     *
     * @param orgId        租户id
     * @param rootGroupId  根组织id
     * @param groupId      组织id
     * @param groupCode    组织编码
     * @param groupName    组织名称
     * @param groupLevelId 层级id
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 14:16
     */
    @Deprecated
    public void publishGroupCreate(String orgId, String rootGroupId, String groupId, String groupCode,
                                   String groupName, String groupLevelId) {
        CreateGroupMessage message = new CreateGroupMessage(orgId, rootGroupId, groupId, groupCode, groupName, groupLevelId);

        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_CREATED, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_CREATED, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_CREATED, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_CREATED, JSON.toJSONString(dto));
        //}
    }

    /**
     * 组织发生变化发送消息
     *
     * @param orgId       租户id
     * @param rootGroupId 根组织id
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 11:44
     */
    public void publishGroupsChange(String orgId, String rootGroupId) {
        if (StringUtils.isBlank(rootGroupId)) {
            ServiceResult<UserGroupDTO> rootGroupByOrgId = userGroupService.getRootGroupByOrgId(orgId);
            if (rootGroupByOrgId.isSuccess() && Objects.nonNull(rootGroupByOrgId.getData())) {
                rootGroupId = rootGroupByOrgId.getData().getGroupId();
            }
        }
        ChangeGroupMessage message = new ChangeGroupMessage(orgId, rootGroupId);

        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUPS_CHANGED, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUPS_CHANGED, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUPS_CHANGED, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUPS_CHANGED, JSON.toJSONString(dto));
        //}
    }

    /**
     * 删除层级发送消息
     *
     * @param orgId        租户id
     * @param groupLevelId 层级id
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 11:46
     */
    public void publishGroupLevelDelete(String orgId, String groupLevelId) {
        //DeleteGroupLevelMessage dto = new DeleteGroupLevelMessage(orgId, groupLevelId);
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUPLEVEL_DELETED, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUPLEVEL_DELETED, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUPLEVEL_DELETED, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUPLEVEL_DELETED, JSON.toJSONString(dto));
        //}
    }

    /**
     * 组织失效发送消息
     *
     * @param orgId   租户id
     * @param groupId 组织id
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 11:48
     */
    @Deprecated
    public void publishGroupInvalidate(String orgId, String groupId) {
        //InvalidateGroupMessage dto = new InvalidateGroupMessage(orgId, groupId);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_INVALIDATE, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_INVALIDATE, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_INVALIDATE, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_INVALIDATE, JSON.toJSONString(dto));
        //}
    }

    /**
     * 组织批量失效发送消息
     *
     * @param orgId    租户id
     * @param groupIds 组织id列表
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:31
     */
    public void publishGroupInvalidateList(String orgId, List<String> groupIds) {
        //InvalidateGroupListMessage dto = new InvalidateGroupListMessage(orgId, groupIds);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_INVALIDATE_LIST, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_INVALIDATE_LIST, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_INVALIDATE_LIST, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_INVALIDATE_LIST, JSON.toJSONString(dto));
        //}
    }

    /**
     * 组织恢复失效发送消息
     *
     * @param orgId   租户id
     * @param groupId 组织id
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:32
     */
    @Deprecated
    public void publishGroupValidate(String orgId, String groupId) {
        //ValidateGroupMessage dto = new ValidateGroupMessage(orgId, groupId);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_VALIDATE, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_VALIDATE, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_VALIDATE, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_VALIDATE, JSON.toJSONString(dto));
        //}
        //ValidateGroupMessage dto = new ValidateGroupMessage(orgId, groupId);
        //try {
        //    messageProducer.send(GroupTopics.USER_GROUP_VALIDATE, dto);
        //} catch (JsonProcessingException e) {
        //    log.error("[user]组织恢复失效:{},{}", JSONUtil.toJsonStr(dto), e);
        //}
    }

    /**
     * 批量组织恢复失效发送消息
     *
     * @param orgId
     * @param groupIds
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/8/3 16:46
     */
    public void publishGroupValidateList(String orgId, List<String> groupIds) {
        //ValidateGroupListMessage dto = new ValidateGroupListMessage(orgId, groupIds);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_VALIDATE_LIST, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_VALIDATE_LIST, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_VALIDATE_LIST, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_VALIDATE_LIST, JSON.toJSONString(dto));
        //    log.error("[User.Group] 发送mq消息失败", e);
        //}
    }

    /**
     * 组织名称变更发送消息
     *
     * @param orgId        租户id
     * @param groupId      组织id
     * @param oldGroupName 旧名称
     * @param newGroupName 新名称
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:34
     */
    public void publishGroupTitleModify(String orgId, String groupId, String oldGroupName, String newGroupName) {
        //ChangeGroupNameMessage dto = new ChangeGroupNameMessage(orgId, groupId, oldGroupName, newGroupName);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_TITLE_MODIFY, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_TITLE_MODIFY, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_TITLE_MODIFY, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_TITLE_MODIFY, JSON.toJSONString(dto));
        //}
    }

    /**
     * 组织名称变更发送消息
     *
     * @param orgId          租户id
     * @param groupNameInfos 组织名称变更信息列表
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:55
     */
    public void publishGroupTitleModifyList(String orgId, List<GroupNameInfo> groupNameInfos) {
        //ChangeGroupNameListMessage dto = new ChangeGroupNameListMessage(orgId, groupNameInfos);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUP_TITLE_MODIFY_LIST, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_TITLE_MODIFY_LIST, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUP_TITLE_MODIFY_LIST, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUP_TITLE_MODIFY_LIST, JSON.toJSONString(dto));
        //}
    }

    /**
     * 新增门店发送消息
     *
     * @param orgId       租户id
     * @param rootGroupId 根组织id
     * @param groupId     组织id
     * @param groupCode   组织编码
     * @param groupName   组织名称
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:46
     */
    @Deprecated
    public void publishCreateStore(String orgId, String rootGroupId, String groupId, String groupCode, String groupName) {
        //CreateStoreMessage dto = new CreateStoreMessage(orgId, rootGroupId, groupId,
        //        new StoreInfo(groupId, groupCode, groupName));
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_NEW_STORE, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_NEW_STORE, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_NEW_STORE, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_NEW_STORE, JSON.toJSONString(dto));
        //}
    }

    /**
     * 批量新增门店发送消息
     *
     * @param orgId       租户id
     * @param rootGroupId 根组织id
     * @param storeInfos  门店信息列表
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:53
     */
    public void publishCreateStoreList(String orgId, String rootGroupId, List<StoreInfo> storeInfos) {
        //CreateStoreListMessage dto = new CreateStoreListMessage(orgId, rootGroupId, storeInfos);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_NEW_STORE_LIST, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_NEW_STORE_LIST, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_NEW_STORE_LIST, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_NEW_STORE_LIST, JSON.toJSONString(dto));
        //}
    }

    /**
     * 层级名称变更发送消息
     *
     * @param orgId             租户id
     * @param groupLevelId      层级id
     * @param oldGroupLevelName 层级旧名称
     * @param newGroupLevelName 层级新名称
     * @author cuiqiongyu <qiongyu.cui@idiaoyan.cn>
     * @date 2022/02/11 13:56
     */
    public void publishGroupLevelTitleModify(String orgId, String groupLevelId, String oldGroupLevelName,
                                             String newGroupLevelName) {
        //ChangeGroupLevelNameMessage dto = new ChangeGroupLevelNameMessage(orgId, groupLevelId, oldGroupLevelName, newGroupLevelName);
        //
        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            GroupTopics.USER_GROUPLEVEL_TITLE_MODIFY, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUPLEVEL_TITLE_MODIFY, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_GROUPLEVEL_TITLE_MODIFY, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_GROUPLEVEL_TITLE_MODIFY, JSON.toJSONString(dto));
        //}
    }

    /**
     * 开放平台异步更新组织层级完成发送消息
     *
     * @param orgId         公司id
     * @param eventId       事件id
     * @param callbackParam 消息回调参数
     * @param eventStatus   事件状态
     * @param errorMessage  更新失败的错误提示信息
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @date 2022/4/21 18:50
     */
    public void publishOpenGroupUpdateFinish(String orgId, String eventId, String callbackParam, Integer eventStatus, String errorMessage) {
        OpenGroupUpdateFinishMessage message = new OpenGroupUpdateFinishMessage(orgId, eventId, callbackParam, eventStatus, errorMessage);

        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), RoutingKeys.APP_FANOUT,
        //            GroupTopics.USER_OPEN_GROUP_UPDATE_FINISH, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.Group] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                GroupTopics.USER_OPEN_GROUP_UPDATE_FINISH, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.Group] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            GroupTopics.USER_OPEN_GROUP_UPDATE_FINISH, JSON.toJSONString(dto));
        //    log.error("[User.Group] 发送mq消息失败", e);
        //}
    }

}
